package org.aldar.bquest.entity;

import org.andengine.entity.modifier.MoveXModifier;
import org.andengine.entity.sprite.Sprite;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.vbo.VertexBufferObjectManager;

/**
 * Created with IntelliJ IDEA.
 * User: Daria
 * Date: 4/22/13
 * Time: 10:52 PM
 * To change this template use File | Settings | File Templates.
 */
public class LandscapeSprite extends Sprite {

    MoveXModifier lastModifier = null;

    float moveDuration = 0f;

    public LandscapeSprite(final float pCellX, final float pCellY, final ITextureRegion pTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager) {
        super((float) pCellX, (float) pCellY, pTextureRegion, pVertexBufferObjectManager);
    }


/*    @Override
    public void registerEntityModifier(IEntityModifier pEntityModifier) {
        pEntityModifier.setAutoUnregisterWhenFinished(true);
        if (getEntityModifierCount() == 0) {
            super.registerEntityModifier(pEntityModifier);
            moveDuration = pEntityModifier.getDuration();
            lastModifier = (MoveXModifier) pEntityModifier;
        } else {
            MoveXModifier moveModifier = (MoveXModifier) pEntityModifier;
            float moveElapsed = lastModifier.getSecondsElapsed();
            float moveRemaining = pEntityModifier.getDuration() - moveElapsed;
            float xCurrent = (moveModifier.getToValue() - moveModifier.getFromValue()) * moveElapsed;
            moveModifier.reset(moveModifier.getDuration() + moveDuration * moveRemaining, this.getX(), lastModifier.getToValue() + (moveModifier.getToValue() - moveModifier.getFromValue()));
            super.unregisterEntityModifier(lastModifier);
            super.registerEntityModifier(moveModifier);
            lastModifier = moveModifier;
        }

    }

    */
}
